package com.huasoft.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class LogoutServlet {
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session = request.getSession();
		session.setAttribute("user", null);
		session.setAttribute("rights", null);
		System.out.println("nihao");
		PrintWriter out = response.getWriter();
		out.println("<script type='text/javascript'> window.parent.location.href='/fms/login.jsp';</script>");
		// request.getRequestDispatcher("/login.jsp").forward(request,
		// response);
	}
}
